<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <title>Package Category</title>

    </head>
    <body>
        <?php
        include('inc/init.php');

        $smarty->assign('title', $title);

        $id = -1;
        if (isset($_GET['id']))
            $id = $_GET['id'];

        $smarty->template_dir = 'templates';

        $dest = $db->prepare("select * from ats_destination");
        $dest->execute();
        $dest->setFetchMode(PDO::FETCH_LAZY);

        $seldest = $db->prepare("select * from ats_destination where id='" . $id . "'");
        $seldest->execute();
        $seldest->setFetchMode(PDO::FETCH_LAZY);

        $city = $db->prepare("select * from ats_city order by city");
        $city->execute();
        $city->setFetchMode(PDO::FETCH_ASSOC);
        
        $packcategory = $db->prepare("select package from ats_package_category order by id");
        $packcategory->execute();
        $packcategory->setFetchMode(PDO::FETCH_ASSOC);

        $city = $db->prepare("select * from ats_city order by city");
        $city->execute();
        $city->setFetchMode(PDO::FETCH_ASSOC);

        $smarty->assign('catid', $id);
        $smarty->assign('dest', $dest);
        $smarty->assign('seldest', $seldest);        
        $smarty->assign('city', $city);
        $smarty->assign('packcategory', $packcategory);

        $cities = $city->fetchAll();
        $smarty->assign('cities', $cities);

        $smarty->display('packagecategory.tpl');
        ?>

    </body>
</html>